#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

const int maxn = 1001;

struct node
{
	int x;
	int y;
};

node da[maxn];
int n;

int calc_h(int x, int y)
{
	return (x+y)+(x+1)*(y+1);
}

bool is_int(double x)
{
	if (fabs(x-int(x)) < 1e-5) return true;
	return false;
}

bool in_hash(int x, int y, const vector<vector<node> >& h)
{
	int index = calc_h(x, y);
	node tmp;
	tmp.x = x; tmp.y = y;
	int p = find(h[index].begin(), h[index].end(), tmp) - h[index].end();
}

bool judge(int x1, int y1, int x2, int y2, const vector<vector<node> >& h)
{
	double ox = (x1+x2)/2.0;
	double oy = (y1+y2)/2.0;
	double bx = -(y1-oy) + ox;
	double by = (x1-ox) + oy;
	if (!(is_int(bx) && is_int(by))) return false;
	int bbx = bx, bby = by;
	if (!in_hash(bbx, bby, h)) return false;
}

int main()
{
	while (scanf("%d", &n) && n != 0) {
		vector <vector<node> > h(n);
		for (int i = 0; i < n; i++) {
			scanf("%d%d", &da[i].x, &da[i].y);
			h[calc_h(da[i].x, da[i].y)].push_back(da[i]);
		}
		int ans = 0;
		for (int i = 0; i < n; i++)
			for (int j = i+1; j < n; j++) {

	}
}

